import {Component, OnInit} from '@angular/core';

@Component({
  selector: 'app-myc01-todolist',
  templateUrl: './myc01-todolist.component.html',
  styleUrls: ['./myc01-todolist.component.css']
})
export class Myc01TodolistComponent implements OnInit {

  constructor() {
  }

  ngOnInit(): void {
  }

  todoList = ["开会", "上课", "约会"]
  userInput: string | undefined;

  doDelete(i: number) {
    this.todoList.splice(i, 1)
  }

  doAdd() {
    console.log(this.userInput)
    if (this.userInput !== undefined) {
      this.todoList.push(this.userInput)
      this.userInput = ""
    }
  }

  empList = [
    {eid:101, ename:"冰冰", salary:5000, birthday:0, sex:0, zzmm:10},
    {eid:102, ename:"曹操", salary:5000, birthday:0, sex:1, zzmm:20},
    {eid:103, ename:"孙权", salary:5000, birthday:0, sex:1, zzmm:30},
    {eid:104, ename:"热巴", salary:5000, birthday:0, sex:0, zzmm:10},
  ]
}
